// 营销访问量
echart_yxfw();
// 全网访问
echart_qwfw();
// 年度营销保费
echart_ndbx();
// 
echart_bffw();





function echart_yxfw(){
        // 基于准备好的dom，初始化echarts实例
        var myChart = echarts.init(document.getElementById('yxfw'));
        var category = []; //当前前12个月每月月份
        var dottedBase = new Date();
        dottedBase.setMonth(dottedBase.getMonth());
        dottedBase.setDate(dottedBase.getDate());
        var date = dottedBase;
        var ri=date.getDate()-11;
        for (var i = 0; i < 10; i++) {
             ri++;

            date.setMonth(date.getMonth());
            category.push([date.getFullYear(), date.getMonth() + 1,
                ri
            ].join('-'));
        }
        category.push('今天')
        category.push('明天')
        option = {
            tooltip: {
                trigger:'axis',
                formatter: "访问量 : {c}次",
                axisPointer: {
                    type: 'cross',
                    crossStyle: {
                        color: '#999'
                    }
                }
            },
            legend: {
                data: ['访问量'],
                align: 'left',
                textStyle:{
                    color:"#000"
                }
            },
            xAxis: [
                {
                    type: 'category',
                    show:true,
                    data:category,
                    axisPointer: {
                        type: 'shadow'
                    },
                    axisTick : {show: true},
                    axisLabel: { //调整x轴的lable
                        textStyle: {
                            color: '#000',
                            fontSize: 13,
                        }
                    },
                    splitLine: {
                        show: false
                    }
                }
            ],
            yAxis: [
                {
                    type: 'value',
                    name: '',
                    axisLabel: {
                        formatter: '{value}次'
                    }
                }
            ],
            series: [
                {
                    name:'访问量',
                    type:'bar',
                    barWidth: '30%',
                    data:['1230','2360','3430','3480','4520','2250','3430','2369','4580','4543','3352','6342'],
                    itemStyle:{
                      color:'#2ab4c0'
                    }
                }
            ]
        };
        // 使用刚指定的配置项和数据显示图表。
        myChart.setOption(option);
        window.addEventListener("resize",function(){
            myChart.resize();
        });    
}
function echart_qwfw(){
        // 基于准备好的dom，初始化echarts实例
        var myChart = echarts.init(document.getElementById('qwfw'));
        option = {
            title:false,
            tooltip: {
                trigger:'axis',
                formatter: "{b} <br/> 营销访问量占全网访问量 : {c}%",
                axisPointer: {
                    type: 'cross',
                    crossStyle: {
                        color: '#999'
                    }
                }
            },
            legend: {
                data:['营销访问量占全网访问量']
            },
            grid: {
                left: '3%',
                right: '4%',
                bottom: '3%',
                containLabel: true
            },
            toolbox: {
                feature: {
                    saveAsImage: {}
                }
            },
            xAxis: {
                type: 'category',
                boundaryGap: false,
                data: ['周一','周二','周三','周四','周五','周六','周日']
            },
            yAxis: {
                type: 'value',
                min:0,
                max:100,
                axisLabel: {
                    formatter: '{value}%'
                }
            },
            series: [
                {
                    name:'营销访问量占全网访问量',
                    type:'line',
                    stack: '总量',
                    data:[30, 79, 40, 60, 90, 50, 90]
                }
            ]
        };
        // 使用刚指定的配置项和数据显示图表。
        myChart.setOption(option);
        window.addEventListener("resize",function(){
            myChart.resize();
        });    
}
function echart_ndbx(){
        // 基于准备好的dom，初始化echarts实例
        var myChart = echarts.init(document.getElementById('ndbx'));
        var category = []; //当前前12个月每月月份
        var dottedBase = new Date();
        dottedBase.setMonth(dottedBase.getMonth());
        dottedBase.setDate(dottedBase.getDate());
        var date = dottedBase;
        var ri=date.getDate()-11;
        for (var i = 0; i < 10; i++) {
             ri++;

            date.setMonth(date.getMonth());
            category.push([date.getFullYear(), date.getMonth() + 1,
                ri
            ].join('-'));
        }
        category.push('今天')
        category.push('明天')
        option = {
            tooltip: {
                trigger:'axis',
                formatter: "保费 : {c}元",
                axisPointer: {
                    type: 'cross',
                    crossStyle: {
                        color: '#999'
                    }
                }
            },
            legend: {
                data: ['保费'],
                align: 'left',
                textStyle:{
                    color:"#000"
                }
            },
            xAxis: [
                {
                    type: 'category',
                    show:true,
                    data:category,
                    axisPointer: {
                        type: 'shadow'
                    },
                    axisTick : {show: true},
                    axisLabel: { //调整x轴的lable
                        textStyle: {
                            color: '#000',
                            fontSize: 13,
                        }
                    },
                    splitLine: {
                        show: false
                    }
                }
            ],
            yAxis: [
                {
                    type: 'value',
                    name: '',
                    axisLabel: {
                        formatter: '{value}元'
                    }
                }
            ],
            series: [
                {
                    name:'保费',
                    type:'bar',
                    barWidth: '30%',
                    data:['34430','32360','23270','55180','11210','12350','53330','66569','78580','23243','53432','233462'],
                    itemStyle:{
                      color:'#3399FF'
                    }
                }
            ]
        };
        // 使用刚指定的配置项和数据显示图表。
        myChart.setOption(option);
        window.addEventListener("resize",function(){
            myChart.resize();
        });    
}
function echart_bffw(){
        // 基于准备好的dom，初始化echarts实例
        var myChart = echarts.init(document.getElementById('bffw'));
        option = {
            title:false,
            tooltip: {
                trigger: 'axis'
            },
            legend: {
                data:['营销保费占全网访问量']
            },
            grid: {
                left: '3%',
                right: '4%',
                bottom: '3%',
                containLabel: true
            },
            toolbox: {
                feature: {
                    saveAsImage: {}
                }
            },
            xAxis: {
                type: 'category',
                boundaryGap: false,
                data: ['周一','周二','周三','周四','周五','周六','周日']
            },
            yAxis: {
                type: 'value',
                min:0,
                max:100,
                axisLabel: {
                    formatter: '{value}%'
                }
            },
            series: [
                {
                    name:'营销保费占全网访问量',
                    type:'line',
                    stack: '总量',
                    data:[30, 79, 40, 60, 90, 50, 90]
                }
            ]
        };
        // 使用刚指定的配置项和数据显示图表。
        myChart.setOption(option);
        window.addEventListener("resize",function(){
            myChart.resize();
        });    
}
